# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1AsyncQuery do
  @moduledoc """


  ## Attributes

  *   `created` (*type:* `String.t`, *default:* `nil`) - Creation time of the query.
  *   `envgroupHostname` (*type:* `String.t`, *default:* `nil`) - Hostname is available only when query is executed at host level.
  *   `error` (*type:* `String.t`, *default:* `nil`) - Error is set when query fails.
  *   `executionTime` (*type:* `String.t`, *default:* `nil`) - ExecutionTime is available only after the query is completed.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Asynchronous Query Name.
  *   `queryParams` (*type:* `GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1QueryMetadata.t`, *default:* `nil`) - Contains information like metrics, dimenstions etc of the AsyncQuery.
  *   `reportDefinitionId` (*type:* `String.t`, *default:* `nil`) - Asynchronous Report ID.
  *   `result` (*type:* `GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1AsyncQueryResult.t`, *default:* `nil`) - Result is available only after the query is completed.
  *   `resultFileSize` (*type:* `String.t`, *default:* `nil`) - ResultFileSize is available only after the query is completed.
  *   `resultRows` (*type:* `String.t`, *default:* `nil`) - ResultRows is available only after the query is completed.
  *   `self` (*type:* `String.t`, *default:* `nil`) - Self link of the query. Example: `/organizations/myorg/environments/myenv/queries/9cfc0d85-0f30-46d6-ae6f-318d0cb961bd` or following format if query is running at host level: `/organizations/myorg/hostQueries/9cfc0d85-0f30-46d6-ae6f-318d0cb961bd`
  *   `state` (*type:* `String.t`, *default:* `nil`) - Query state could be "enqueued", "running", "completed", "failed".
  *   `updated` (*type:* `String.t`, *default:* `nil`) - Last updated timestamp for the query.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :created => String.t() | nil,
          :envgroupHostname => String.t() | nil,
          :error => String.t() | nil,
          :executionTime => String.t() | nil,
          :name => String.t() | nil,
          :queryParams => GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1QueryMetadata.t() | nil,
          :reportDefinitionId => String.t() | nil,
          :result => GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1AsyncQueryResult.t() | nil,
          :resultFileSize => String.t() | nil,
          :resultRows => String.t() | nil,
          :self => String.t() | nil,
          :state => String.t() | nil,
          :updated => String.t() | nil
        }

  field(:created)
  field(:envgroupHostname)
  field(:error)
  field(:executionTime)
  field(:name)
  field(:queryParams, as: GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1QueryMetadata)
  field(:reportDefinitionId)
  field(:result, as: GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1AsyncQueryResult)
  field(:resultFileSize)
  field(:resultRows)
  field(:self)
  field(:state)
  field(:updated)
end

defimpl Poison.Decoder, for: GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1AsyncQuery do
  def decode(value, options) do
    GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1AsyncQuery.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1AsyncQuery do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
